package com.extremelylargepackage.entity;

import android.graphics.Canvas;

public class ArtificialIntelligence 
{
	private AiMoveComponent _move;
	private AiAttackComponent _attack;

	public ArtificialIntelligence(AiMoveComponent move, AiAttackComponent attack)
	{
		_move = move;
		_attack = attack;
	}
	
	public void performAi(long time)
	{
		if(_move != null)
			_move.performMove(time);
		if(_attack != null)
			_attack.peformAttack(time);
	}
	
	public void setEnemy(Enemy enemy)
	{
		if(_move != null)
			_move.setSelf(enemy);
		if(_attack != null)
			_attack.setSelf(enemy);
	}
	
	public Object clone()
	{
		AiMoveComponent move = null;
		AiAttackComponent attack = null;
		if(_move != null)
			move = (AiMoveComponent) _move.clone();
		if(_attack != null)
			attack = (AiAttackComponent) _attack.clone(); 
		return new ArtificialIntelligence(move, attack);
	}
	
	public boolean finished()
	{
		return _move.finished();
	}
}

